//
//  ZJMineProjectCell.m
//  这家测试项目
//
//  Created by IOS_DEVELOPER on 2017/6/7.
//  Copyright © 2017年 陈志凌. All rights reserved.
//

#import "ZJMineProjectCell.h"

@implementation ZJMineProjectCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    self.shareBtn.layer.borderColor = RGB(235, 235, 235).CGColor;
    self.shareBtn.layer.borderWidth = 1.0f;
    self.downPhotoBtn.layer.borderColor = RGB(235, 235, 235).CGColor;
    self.downPhotoBtn.layer.borderWidth = 1.0f;
    [self.shareBtn addTarget:self action:@selector(clickBtn:) forControlEvents:(UIControlEventTouchUpInside)];

    ZJUserModel * model = GET_USERINFO;
    [HMScannerController cardImageWithCardName:model.qrcode_url avatar:nil scale:0.2 completion:^(UIImage *image) {
        
        //        self.pay_codeView.backgroundColor = [UIColor colorWithPatternImage:image];
        self.QRImage.image = image;
    }];
}

- (NSTimeInterval)animationDurationWithItemIndex:(NSInteger)itemIndex animationType:(AnimationType)type
{
    NSArray<NSNumber *> *array = @[@(0.35f),@(.35f),@(.35f)];
    return array[itemIndex].doubleValue;
}

-(void)clickBtn:(UIButton *)sender{
    
    if (_delegate != nil && [_delegate respondsToSelector:@selector(onClickRoom:)]) {
        NSMutableDictionary * dict = [NSMutableDictionary  new];
        dict[@"btnID"] = @(sender.tag);
        dict[@"btnTitle"] = sender.titleLabel.text;
        [_delegate onClickRoom:dict];
    }
}

-(void) onClickRoom:(NSDictionary *) roomDict{
    
    if (_delegate != nil && [_delegate respondsToSelector:@selector(onClickRoom:)]) {
        [_delegate onClickRoom:roomDict];
    }
}
@end
